#ifndef DISPLAY_H
#define DISPLAY_H

#include <gtkmm.h>
#include <string>
#include "fractal.h"

#define MAX_SAMPLES 8

class Display : public Gtk::Window {
	public:
		Display(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& refGlade);
		~Display();
		void updateImage();
		void updateFractal();
	protected:
		void render();
		bool update();
		void on_imagemenuitem_new_activate();
		void on_imagemenuitem_save_activate();
		void on_imagemenuitem_quit_activate();
		void on_radiomenuitem_aasamples_toggled(int samples);
		void on_menuitem_gradient_activate();
		void on_menuitem_size_activate();
		bool on_eventbox_button_press_event(GdkEventButton* event);
		bool on_eventbox_button_release_event(GdkEventButton* event);
		bool on_eventbox_motion_notify_event(GdkEventMotion* event);
		bool on_eventbox_leave_notify_event(GdkEventCrossing* event);
		bool on_eventbox_expose_event(GdkEventExpose* event);
		Fractal* fractal_;
		Gtk::ImageMenuItem* imagemenuitem_new_;
		Gtk::ImageMenuItem* imagemenuitem_save_;
		Gtk::ImageMenuItem* imagemenuitem_quit_;
		Gtk::RadioMenuItem* radiomenuitem_aasamples_[MAX_SAMPLES];
		Gtk::MenuItem* menuitem_gradient_;
		Gtk::MenuItem* menuitem_size_;
		Gtk::EventBox* eventbox_;
		Gtk::Image* image_;
		Gtk::Statusbar* statusbar_;
		Gtk::ProgressBar* progressbar_;
		Gtk::Label* label_;
		int dragX_;
		int dragY_;
		int nThreads_;
		unsigned int time_;
		
		bool updateFractal_;
};

#endif
